﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SGRapidForm.Permission.Service.Interface;
using SGRapidForm.Permission.Component;
using SGRapidForm.Permission.Entity;
using Microsoft.Practices.Unity;

namespace SGRapidForm.Permission.Service
{
    /// <summary>
    /// 按钮服务
    /// </summary>
    public partial class PermissionService : IPermissionService
    {
        [Dependency]
        public ButtonComponent ButtonComponent
        { get; set; }

        public List<ButtonEntity> Button_GetAll()
        {
            return this.ButtonComponent.Button_GetAll();
        }

        public bool Button_Add(ButtonEntity buttonEntity)
        {
            return this.ButtonComponent.AddButton(buttonEntity);
        }

        public bool Button_Delete(string keyid)
        {
            return this.ButtonComponent.DeleteButton(keyid);
        }

        public bool Button_Update(ButtonEntity buttonEntity)
        {
            return this.ButtonComponent.UpdateButton(buttonEntity);
        }

        /// <summary>
        /// 批量删除按钮
        /// </summary>
        public bool Button_BulkDelete(string keyids)
        {
            return this.ButtonComponent.BulkDeleteButton(keyids);
        }

        public List<ButtonEntity> Button_PagingGet(int startRecord, int maxRecords, string sortColumns, string filterConditions)
        {
            return this.ButtonComponent.PagingGetButtons(startRecord, maxRecords, sortColumns, filterConditions);
        }

        public int Button_PagingGetCount(string filterConditions)
        {
            return this.ButtonComponent.PagingGetButtonCount(filterConditions);
        }

        public ButtonEntity Button_GetByKeyid(string keyid)
        {
            return this.ButtonComponent.GetButtonByKeyid(keyid);
        }

        public List<ButtonEntity> Button_GetByPageKeyid(string keyid)
        {
            return this.ButtonComponent.GetButtonByPageKeyid(keyid);
        }

        public bool Button_DetectBeforeImporting(string pageCode)
        {
            return this.ButtonComponent.Button_DetectBeforeImporting(pageCode);
        }
    }
}
